package org.dru.clay.resolver;

import java.io.File;

import org.dru.clay.respository.artifact.Artifact;
import org.dru.clay.respository.artifact.Module;

public class IvyDirectoryLayout implements DirectoryLayout {
	@Override
	public File directory(File baseDir, Module module) {
		File orgDir = new File(baseDir, module.getGroup().get());
		File modDir = new File(orgDir, module.getArtifact().asString());
		return modDir;
	}

	@Override
	public File file(File baseDir, Module module, Artifact artifact) {
		File modDir = directory(baseDir, module);
		File file = new File(modDir, artifact.asString());
		return file;
	}

}
